package domain

import (
	"apitestAfterGo/dto"
	"time"
)

type Urls struct {
	Id         int       `json:"id"`
	Detail     string    `json:"detail"`
	Url        string    `json:"url"`
	ParentId   int       `json:"parent_id"`
	Icon       string    `json:"icon"`
	Children   []Urls    `json:"children"`
	CreateBy   string    `json:"create_by"`
	CreateTime time.Time `json:"create_time"`
	UpdateBy   string    `json:"update_by"`
	UpdateTime time.Time `json:"update_time"`
	IsDelete   int       `json:"is_delete" gm:"logic"`
}

type UrlsMapper struct {
	DeleteTemplate        func(id int) (int64, error)         `args:"id"`
	FindUrlsById          func(urls []string) ([]Urls, error) `args:"urls"`
	FindUrlsByParentId    func(id int) ([]Urls, error)        `args:"id"`
	FindAllUrls           func() ([]Urls, error)
	AddUrl                func(urls Urls) (int64, error)
	SelectTemplate        func(id int) (Urls, error) `args:"id"`
	GetAllUrls            func(dto dto.UrlInputDto) ([]Urls, error)
	GetUrlsByUser         func(urls []string) ([]Urls, error) `args:"urls"`
	UpdateUrlById         func(url Urls) (int64, error)
	GetAllUrlsCountByPage func(dto dto.UrlInputDto) (int, error)
	UpdateUrlByUserId     func(dto dto.UrlEditInputDto) (int, error)
	GetUrlsByUserId       func(id int) (string, error) `args:"id"`
	FindUrlsByCurrentId   func(dto dto.UrlSqlDto) ([]Urls, error)
}
